import React from 'react';
import {
    Table,
    Row,
    Col,
    Form,
    Input,
    Icon,
    InputNumber,
    Radio,
    DatePicker,
    Select,
    Upload,
    Button,
    Switch,
    Modal,
    Popconfirm,
    Tabs,
    message
} from 'antd';

const R = require('ramda');
import OperatorConstant from "../../../utils/OperatorConstant";
import BizParams from '../../../components/commons/BizParams'
import CurrencySelect from '../../../components/commons/CurrencySelect'
import IndustrySelect from '../../../components/commons/IndustrySelect'
import ManageSelect from '../../../components/commons/ManageSelect'
import Validator from '../../../utils/Validator'
import RightBox from "../../../components/commons/RightBox";
import PersonnelAllocation from '../components/PersonnelAllocation';
import moment from 'moment'
import RightContacts from "../../../utils/RightConstants";
import Constants from "../../../utils/Constants";

const TabPane = Tabs.TabPane;
const FormItem = Form.Item;
const RadioGroup = Radio.Group;
const Option = Select.Option;
const csttype = ["普通客户", "会员客户"];


export default Form.create({wrappedComponentRef: true})(class EditCustomer extends React.Component {

    constructor(props) {
        super(props);
        let dataSource = R.isNil(this.props.dataSource) ? {} : this.props.dataSource

        this.state = {
            open: false,
            disabled: true,
            type: R.isNil(this.props.type) ? "" : this.props.type,
        };
    }

    handleResetFields = () => {
        if (this.personnelAllocation) this.personnelAllocation.handleResetFields();
        setTimeout(this.props.form.resetFields, 1001);
    }


    checkAgencyagreementList = () => {
        return !R.isEmpty(this.props.agencyagreementList);
    }

    handleCustomer = () => {
        if (this.state.type == OperatorConstant.add) {
            return false;
        } else if (this.props.dataSource.csttype === '1') {
            return true;
        }
    }

    handleAddBlacklist = (id) => {
        let values = this.props.form.getFieldsValue();
        if (R.isEmpty(values.blacklistMemo)) {
            message.error("请输入黑名单备注！");
            return;
        }

        if (values.isblacklist) {
            message.error("此用户已经在黑名单中！");
            return;
        }
        this.props.dispatch({
            type: 'blacklist/addBlacklist',
            payload: {
                cstId: id,
                memo: values.blacklistMemo,
                onSuccess: () => {
                    this.props.dispatch({type: 'customerManage/getCustomerById', payload: {id: id, isApproval: true}});
                },
                onFail: () => {
                    message.error("黑名单加入失败");
                }
            }
        })
    }

    handleUpdatePersonnel = () => {
        let dataSource = R.isNil(this.props.dataSource) ? {} : this.props.dataSource;
        let values = this.props.form.getFieldsValue();

        if (R.isEmpty(values.manager) || R.isNil(values.manager)) {
            message.error("请选择业务经理！");
            return;
        }

        this.props.dispatch({
            type: "customerManage/updateCustomerBase",
            payload: {
                cstid: this.props.cstid,
                id: dataSource.id,
                manager: values.manager,
                onSuccess: () => {

                }


            }
        })
    }


    checkCustomerInfo = (dispatch, onSuccess, cstid, changeStatus) => {

        this.props.form.validateFields((errors, values) => {
            if (errors) {
                return;
            }

            let dataSource = R.isNil(this.props.dataSource) ? {} : this.props.dataSource
            if (!this.checkAgencyagreementList() && this.state.type == "edit" && changeStatus === 2 && dataSource.csttype === "") { //提交审核才执行这个判断
                message.error("合作信息/代理协议列表为空，请检查");
                return;
            }

            let functionname = "";
            if (this.state.type == "add") {
                functionname = "createCustomer";

            } else if (this.state.type == "edit") {
                functionname = "updateCustomerBase";
            }

            let payload = {};
            payload.id = cstid;
            payload.companyname = values.companyname;
            payload.companynameen = values.companynameen;
            payload.shortname = values.shortname;
            payload.ischeckinfo = values.ischeckinfo;
            payload.companytype = values.companytype;
            payload.businessmodel = values.businessmodel;
            payload.telephone = values.telephone;
            payload.mobile = values.mobile;
            payload.tax = values.tax;
            payload.email = values.email;
            payload.invoicetype = values.invoicetype;
            payload.csttype = values.csttype;
            payload.address = values.address;
            payload.addressen = values.addressen;
            payload.recaddress = values.recaddress;
            payload.url = values.url;


            payload.industry = R.isNil(values.industry) ? null : values.industry[0];
            payload.mainproduct = R.isNil(values.industry) ? null : values.industry[1];


            payload.subindustry = values.subindustry;
            payload.settlement = values.settlement;
            payload.lastexports = values.lastexports;
            payload.premonthexportamount = values.premonthexportamount;
            payload.entrust = values.entrust;
            payload.exportcountry = values.exportcountry;
            payload.fkmanager = values.fkmanager;

            payload.capital = values.capital;
            payload.capitalcurrency = values.capitalcurrency;
            payload.registerdate = values.registerdate ? values.registerdate.format(Constants.DATEFORMAT) : "";
            payload.bussiregno = values.bussiregno;
            payload.taxpayerid = values.taxpayerid;
            payload.orgcode = values.orgcode;
            payload.customsregno = values.customsregno;
            payload.entperson = values.entperson;
            payload.autoSync = values.autoSync;
            payload.taxId = values.taxId;
            payload.onSuccess = () => {
                onSuccess();
            };

            if (changeStatus == 2) {
                payload.status = changeStatus;
            }


            dispatch({
                type: 'customerManage/' + functionname,
                payload: payload
            });


        })
    };


    render() {
        const {getFieldDecorator, getFieldValue} = this.props.form;
        let dataSource = R.isNil(this.props.dataSource) ? {} : this.props.dataSource;

        let formItemLayout = {
            labelCol: {xs: {span: 24}, sm: {span: 9}},
            wrapperCol: {xs: {span: 24}, sm: {span: 10}}
        };

        const formItemLayout2 = {
            labelCol: {span: 5},
            wrapperCol: {span: 18}
        };

        let industry = [];
        R.isNil(dataSource.industry) ? "" : industry.push(dataSource.industry);
        R.isNil(dataSource.mainproduct) ? "" : industry.push(dataSource.mainproduct);

        return (
            <Form>
                <Tabs tabPosition={'top'}>
                    <TabPane tab="企业信息" key="1">
                        <Row>
                            <Col span={22}>
                                <FormItem
                                    {...formItemLayout2}
                                    label="客户名称(中文)"
                                    hasFeedback
                                >
                                    {getFieldDecorator('companyname', {
                                        rules: [{
                                            required: true, message: '请填写客户名称(中文)！',
                                        }],
                                        initialValue: dataSource.companyname

                                    })(
                                        <Input disabled={this.props.disabled} maxLength="50"/>
                                    )}
                                </FormItem>
                            </Col>
                        </Row>

                        <Row>
                            <Col span={22}>
                                <FormItem
                                    {...formItemLayout2}
                                    label="客户名称（英文）"
                                    hasFeedback
                                >
                                    {getFieldDecorator('companynameen', {
                                        rules: [{
                                            required: true, message: '请填写客户名称(英文)！',
                                        }],
                                        initialValue: dataSource.companynameen
                                    })(
                                        <Input disabled={this.props.disabled} maxLength="200"/>
                                    )}
                                </FormItem>
                            </Col>
                        </Row>


                        <Row>
                            <Col span={12}>
                                <FormItem
                                    {...formItemLayout}
                                    label="客户简称"
                                    hasFeedback
                                >
                                    {getFieldDecorator('shortname', {
                                        rules: [{
                                            required: true, message: '请填写客户简称！',
                                        }],
                                        initialValue: dataSource.shortname
                                    })(
                                        <Input disabled={this.props.disabled} maxLength="30"/>
                                    )}
                                </FormItem>
                            </Col>
                            <Col span={12}>
                                <FormItem
                                    {...formItemLayout}
                                    label="是否查询企业信用"
                                    hasFeedback
                                >
                                    {getFieldDecorator('ischeckinfo', {
                                        rules: [{
                                            required: true, message: '请选择是否查询企业信用！',
                                        }],
                                        initialValue: dataSource.ischeckinfo
                                    })(
                                        <RadioGroup disabled={this.props.disabled}>
                                            <Radio value={"1"}>是</Radio>
                                            <Radio value={"2"}>否</Radio>
                                        </RadioGroup>
                                    )}
                                </FormItem>
                            </Col>
                        </Row>

                        <Row>
                            <Col span={12}>
                                <FormItem
                                    {...formItemLayout}
                                    label="企业类型"
                                    hasFeedback
                                >
                                    {getFieldDecorator('companytype', {
                                        rules: [{
                                            required: true, message: '请选择企业类型！'
                                        }],
                                        initialValue: dataSource.companytype
                                    })(
                                        <BizParams sprCode={"cstType"} style={{width: '100%'}} blank={true}
                                                   disabled={this.props.disabled}/>
                                    )}
                                </FormItem>
                            </Col>

                            <Col span={12}>
                                <FormItem
                                    {...formItemLayout}
                                    label="经营模式"
                                    hasFeedback
                                >
                                    {getFieldDecorator('businessmodel', {
                                        rules: [{
                                            required: true, message: '请选择经营模式！',
                                        }],
                                        initialValue: R.isNil(dataSource.businessmodel) ? "" : dataSource.businessmodel + ""
                                    })(
                                        <BizParams sprCode={"businessModel"} style={{width: '100%'}} blank={true}
                                                   disabled={this.props.disabled}/>
                                    )}
                                </FormItem>
                            </Col>

                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem
                                    {...formItemLayout}
                                    label="移动电话"
                                    hasFeedback
                                >
                                    {getFieldDecorator('mobile', {
                                        rules: [
                                            {required: true, message: '请填写移动电话！'},
                                            {pattern: Validator.mobile, message: '请输入正确的移动电话'},
                                        ],
                                        initialValue: dataSource.mobile
                                    })(
                                        <Input disabled={this.props.disabled} maxLength="20"/>
                                    )}
                                </FormItem>
                            </Col>

                            <Col span={12}>
                                <FormItem
                                    {...formItemLayout}
                                    label="固定电话"
                                    hasFeedback
                                >
                                    {getFieldDecorator('telephone', {
                                        rules: [
                                            {required: true, message: '请填写固定电话！'},
                                            {pattern: Validator.phone, message: '请填写正确的固定电话'},
                                        ],
                                        initialValue: dataSource.telephone
                                    })(
                                        <Input disabled={this.props.disabled} maxLength="20"/>
                                    )}
                                </FormItem>
                            </Col>

                        </Row>
                        <Row>
                            <Col span={12}>
                                <FormItem
                                    {...formItemLayout}
                                    label="邮箱（E-mail）"
                                    hasFeedback
                                >
                                    {getFieldDecorator('email', {
                                        rules: [
                                            {required: true, message: '请填写邮箱！'},
                                            {type: 'email', message: '请填写正确的邮箱',}
                                        ],
                                        initialValue: dataSource.email
                                    })(
                                        <Input disabled={this.props.disabled} maxLength="30"/>
                                    )}
                                </FormItem>
                            </Col>

                            <Col span={12}>
                                <FormItem
                                    {...formItemLayout}
                                    label="传真"
                                    hasFeedback
                                >
                                    {getFieldDecorator('tax', {
                                        rules: [
                                            {required: false, message: '请填写传真！'},
                                            {pattern: Validator.fax, message: '请填写正确的传真'},
                                        ],
                                        initialValue: dataSource.tax
                                    })(
                                        <Input disabled={this.props.disabled} maxLength="20"/>
                                    )}
                                </FormItem>
                            </Col>

                        </Row>


                        <Row>
                            <Col span={22}>
                                <FormItem
                                    {...formItemLayout2}
                                    label="公司网址"
                                    hasFeedback
                                >
                                    {getFieldDecorator('url', {
                                        initialValue: dataSource.url
                                    })(
                                        <Input disabled={this.props.disabled} maxLength="100"/>
                                    )}
                                </FormItem>
                            </Col>
                        </Row>

                        <Row>
                            <Col span={22}>
                                <FormItem
                                    {...formItemLayout2}
                                    label="公司地址(中文)"
                                    hasFeedback
                                >
                                    {getFieldDecorator('address', {
                                        rules: [{
                                            required: true, message: '请填写公司地址(中文)！',
                                        }],
                                        initialValue: dataSource.address
                                    })(
                                        <Input disabled={this.props.disabled} maxLength="100"/>
                                    )}
                                </FormItem>
                            </Col>
                        </Row>

                        <Row>
                            <Col span={22}>
                                <FormItem
                                    {...formItemLayout2}
                                    label="公司地址(英文)"
                                    hasFeedback
                                >
                                    {getFieldDecorator('addressen', {
                                        rules: [{
                                            required: dataSource.csttype === "1", message: '请填写公司地址(英文)！',
                                        }],
                                        initialValue: dataSource.addressen
                                    })(
                                        <Input disabled={this.props.disabled} maxLength="100"/>
                                    )}
                                </FormItem>
                            </Col>
                        </Row>

                        <Row>
                            <Col span={22}>
                                <FormItem
                                    {...formItemLayout2}
                                    label="收件地址"
                                    hasFeedback
                                >
                                    {getFieldDecorator('recaddress', {
                                        rules: [{
                                            required: true, message: '请填写收件地址！',
                                        }],
                                        initialValue: dataSource.recaddress
                                    })(
                                        <Input disabled={this.props.disabled} maxLength="100"/>
                                    )}
                                </FormItem>
                            </Col>
                        </Row>
                    </TabPane>
                </Tabs>

                {this.state.type == "edit" ?
                    <span>
                                        <Tabs tabPosition={'top'}>
                                        <TabPane tab="工商注册信息" key="2">
                                        <Row>
                                        <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="注册资本"
                                            hasFeedback
                                        >
                                        {getFieldDecorator('capital', {
                                            rules: [{
                                                required: true, message: '请填写注册资本！',
                                            }],
                                            initialValue: dataSource.capital
                                        })(
                                            <InputNumber style={{width: 150}} disabled={this.props.disabled} maxLength="20"/>
                                        )}
                                            （万）
                                        </FormItem>
                                        </Col>
                                        <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="注册资本币种"
                                            hasFeedback
                                        >
                                        {getFieldDecorator('capitalcurrency', {
                                            rules: [{
                                                required: true, message: '请选择注册资本币种！',
                                            }],
                                            initialValue: dataSource.capitalcurrency
                                        })(
                                            <CurrencySelect disabled={this.props.disabled}/>
                                        )}
                                        </FormItem>
                                        </Col>
                                        </Row>
                                        <Row>
                                        <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="成立日期"
                                            hasFeedback
                                        >
                                        {getFieldDecorator('registerdate', {
                                            rules: [{
                                                required: true, message: '请填写成立日期！',
                                            }],
                                            initialValue: dataSource.registerdate == undefined ? '' : moment(dataSource.registerdate, Constants.DATEFORMAT)
                                        })(
                                            <DatePicker style={{width: 150}} disabled={this.props.disabled}/>
                                        )}
                                        </FormItem>
                                        </Col>
                                        <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="统一信用代码证"
                                            hasFeedback
                                        >
                                        {getFieldDecorator('bussiregno', {
                                            rules: [{
                                                required: true, message: '请填写统一信用代码证！',
                                            }],
                                            initialValue: dataSource.bussiregno
                                        })(
                                            <Input disabled={this.props.disabled} maxLength="20"/>
                                        )}
                                        </FormItem>
                                        </Col>
                                        </Row>

                                        <Row>
                                        <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="海关注册登记号码"
                                            hasFeedback
                                        >
                                        {getFieldDecorator('customsregno', {
                                            rules: [{
                                                required: true, message: '请填写海关注册登记号码！',
                                            }],
                                            initialValue: dataSource.customsregno
                                        })(
                                            <Input disabled={this.props.disabled} maxLength="20"/>
                                        )}
                                        </FormItem>
                                        </Col>
                                        <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="企业法人"
                                            hasFeedback
                                        >
                                        {getFieldDecorator('entperson', {
                                            rules: [{
                                                required: true, message: '请填写企业法人！',
                                            }],
                                            initialValue: dataSource.entperson
                                        })(
                                            <Input disabled={this.props.disabled} maxLength="30"/>
                                        )}
                                        </FormItem>
                                        </Col>
                                        </Row>
                                        </TabPane>
                                        </Tabs>
                                        <Tabs tabPosition={'top'}>
                                        <TabPane tab="营业信息" key="3">
                                        <Row>
                                        <Col span={22}>
                                        <FormItem
                                            {...formItemLayout2}
                                            label="主营产品  "
                                            hasFeedback
                                        >
                                        {getFieldDecorator('industry', {
                                            rules: [{
                                                required: true, message: '请填写主营产品！',
                                            }],
                                            initialValue: industry
                                        })(
                                            <IndustrySelect disabled={this.props.disabled}/>
                                        )}
                                        </FormItem>
                                        </Col>

                                        </Row>
                                        <Row>
                                        <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="主要付汇方式"
                                            hasFeedback
                                        >
                                        {getFieldDecorator('settlement', {
                                            rules: [{
                                                required: true, message: '请选择主要付汇方式！',
                                            }],
                                            initialValue: dataSource.settlement
                                        })(
                                            <BizParams sprCode={"settlement"} style={{width: '100%'}} blank={true}
                                                       disabled={this.props.disabled}/>
                                        )}
                                        </FormItem>
                                        </Col>
                                        <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="年进口额"
                                            hasFeedback
                                        >
                                        {getFieldDecorator('lastexports', {
                                            rules: [{
                                                required: true, message: '请填写年进口额！',
                                            }],
                                            initialValue: dataSource.lastexports
                                        })(
                                            <InputNumber min={0} style={{width: 150}} disabled={this.props.disabled} maxLength="18"/>
                                        )}
                                            （万美元）
                                        </FormItem>
                                        </Col>
                                        </Row>
                                        <Row>
                                        <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="预计每月进口额"
                                            hasFeedback
                                        >
                                        {getFieldDecorator('premonthexportamount', {
                                            rules: [{
                                                required: true, message: '请填写预计每月进口额！',
                                            }],
                                            initialValue: dataSource.premonthexportamount
                                        })(
                                            <InputNumber min={0} style={{width: 150}} disabled={this.props.disabled} maxLength="18"/>
                                        )}
                                            （万美元）
                                        </FormItem>
                                        </Col>
                                        <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="预计每年委托进口额"
                                            hasFeedback
                                        >
                                        {getFieldDecorator('entrust', {
                                            rules: [{
                                                required: true, message: '请填写预计每年委托进口额！',
                                            }],
                                            initialValue: dataSource.entrust
                                        })(
                                            <InputNumber min={0} style={{width: 150}} disabled={this.props.disabled} maxLength="18"/>
                                        )}
                                            （万美元）
                                        </FormItem>
                                        </Col>
                                        </Row>
                                        <Row>
                                        <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="主要进口国家/地区"
                                            hasFeedback
                                        >
                                        {getFieldDecorator('exportcountry', {
                                            rules: [{
                                                required: true, message: '请选择主要进口国家/地区！',
                                            }],
                                            initialValue: dataSource.exportcountry
                                        })(
                                            <BizParams sprCode={"country"} style={{width: '100%'}} blank={true}
                                                       disabled={this.props.disabled}/>
                                        )}
                                        </FormItem>
                                        </Col>
                                        <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="行业经营年限"
                                            hasFeedback
                                        >
                                        {getFieldDecorator('subindustry', {
                                            rules: [{
                                                required: true, message: '请填写主要行业经营年限！',
                                            }],
                                            initialValue: dataSource.subindustry
                                        })(
                                            <InputNumber min={0} style={{width: 150}} disabled={this.props.disabled} maxLength="11"/>
                                        )}
                                        </FormItem>
                                        </Col>
                                        </Row>
                                        </TabPane>
                                        </Tabs>
                                        </span>
                    : ""}

                {this.state.type == "edit" && !R.equals(dataSource.csttype, "2") ?
                    <div>
                        <Tabs tabPosition={'top'}>
                            <TabPane tab="人员分配" key="3">
                                <Row>
                                    <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="风控经理分配"
                                            hasFeedback
                                        >
                                            {getFieldDecorator('fkmanager', {
                                                rules: [{
                                                    required: true, message: '请选择风控经理分配！',
                                                }],
                                                initialValue: dataSource.fkmanager
                                            })(
                                                <ManageSelect sprCode={"fkmanager"} style={{width: '100%'}} blank={true}
                                                              disabled={this.props.disabled}/>
                                            )}
                                        </FormItem>
                                    </Col>
                                </Row>
                            </TabPane>
                        </Tabs>
                        <RightBox resource={RightContacts.CUSTOMER.CUSTOMER_PERSONNEL_ASSIGNMENT}>
                            <Tabs tabPosition={'top'}>
                                <TabPane tab="其他人员分配" key="4">

                                    <Col span={12}>
                                        <FormItem
                                            {...formItemLayout}
                                            label="业务经理分配"
                                            hasFeedback
                                        >
                                            {getFieldDecorator('manager', {
                                                rules: [{
                                                    required: false, message: '请选择业务经理！',
                                                }],
                                                initialValue: dataSource.manager
                                            })(
                                                <ManageSelect sprCode={"ywmanager"} style={{width: '100%'}} blank={true}
                                                              disabled={this.props.disabled}/>
                                            )}
                                        </FormItem>
                                    </Col>
                                    <Col span={12}>
                                        <span style={{marginLeft: 20}}>

                                        <Button type="primary" icon="className" size={'default'}
                                                disabled={this.props.disabled}
                                                onClick={this.handleUpdatePersonnel.bind(this)} style={{
                                            display: this.props.disabled ? 'none' : 'inline-block',
                                            marginLeft: 10
                                        }}>确认分配</Button>

                                        </span>
                                    </Col>
                                </TabPane>
                            </Tabs>
                        </RightBox>
                        <RightBox resource={RightContacts.CUSTOMER.CUSTOMER_ADD_FACTORYCUSTOMER}>
                            <Tabs tabPosition={'top'}>
                                <TabPane tab="开设工厂客户" key="4">
                                    <Col span={12}>
                                        <Popconfirm placement="leftTop" title={'是否确定开设工厂用户账号？'}
                                                    onConfirm={() => {
                                                        this.props.dispatch({
                                                            type: 'customerManage/createFactotyCustomer',
                                                            payload: {
                                                                customerId: dataSource.id,
                                                                onSuccess: () => {
                                                                    this.props.dispatch({
                                                                        type: 'customerManage/getCustomerById',
                                                                        payload: {id: dataSource.id, isApproval: true}
                                                                    });
                                                                },
                                                                onFail: () => {
                                                                    message.error("开设工厂用户账号失败！");
                                                                }
                                                            }
                                                        })
                                                    }} okText="是" cancelText="否">
                                            <Button type="primary"
                                                    icon="className"
                                                    size={'default'}
                                                    disabled={this.props.factoryUser ? true : false}>开设工厂用户</Button>
                                        </Popconfirm>
                                    </Col>
                                </TabPane>
                            </Tabs>
                        </RightBox>
                        {R.isNil(this.props.blacklist) ? "" :
                            <Tabs tabPosition={'top'}>
                                <TabPane tab="黑名单" key="4">
                                    <Row>
                                        <Col span={12}>
                                            <FormItem
                                                {...formItemLayout2}
                                                label="黑名单备注"
                                                hasFeedback
                                            >
                                                {getFieldDecorator('blacklistMemo', {
                                                    rules: [{
                                                        required: false, message: '请黑名单备注',
                                                    }],
                                                    initialValue: dataSource.blacklistMemo
                                                })(
                                                    <Input.TextArea disabled={dataSource.isblacklist ? true : false}
                                                                    maxLength="200"
                                                                    autosize={{minRows: 2, maxRows: 3}}/>
                                                )}
                                            </FormItem>
                                        </Col>
                                        {(R.isEmpty(dataSource.isblacklist) || dataSource.isblacklist) ?
                                            "" :
                                            <Col span={12}>
                                                <RightBox resource={RightContacts.CUSTOMER.CUSTOMER_BLACKLIST_ADD}>
                                                    <Button type="primary" icon="add"
                                                            onClick={this.handleAddBlacklist.bind(this, dataSource.id)}>加入黑名单</Button>
                                                </RightBox>
                                            </Col>
                                        }
                                    </Row>
                                </TabPane>
                            </Tabs>
                        }
                    </div>
                    : ""}

            </Form>
        )
    }


})


// WEBPACK FOOTER //
// ./public/src/components/customer/components/EditCustomer.js
